<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章列表</title>

    <link rel="stylesheet" href="../assets/lib/layui/css/layui.css">
    <!-- 自己的 -->
    <link rel="stylesheet" href="../assets/css/article/list.css">
</head>

<body>

    <div class="layui-card">
        <div class="layui-card-header">文章列表</div>
        <div class="layui-card-body">
            <form class="layui-form" action="" id="list-form">
                <!-- 所有分类 -->
                <div class="layui-input-block">
                    <select name="cate_id" lay-verify="required" class="sele1">

                    </select>
                </div>
                <!-- 所有状态 -->
                <div class="layui-input-block">
                    <select name="state" lay-verify="required">
                        <option value="">所有状态</option>
                        <option value="已发布">已发布</option>
                        <option value="草稿">草稿</option>
                    </select>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                      <button class="layui-btn" lay-submit lay-filter="formDemo">筛选</button>
                    </div>
                  </div>
            </form>

            <!-- 列表 -->
            <table class="layui-table">
                <colgroup>
                    <col>
                    <col width="180">
                    <col width="180">
                    <col width="180">
                    <col width="140">
                </colgroup>
                <thead>
                    <tr>
                        <th>文章标题</th>
                        <th>分类</th>
                        <th>发表时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                    
                </tbody>
            </table>
            <!-- 分页 -->
            <div id="page"></div>
        </div>
    </div>

    <!-- 文章列表 模板 开始 -->
    <script type="text/html" id="list_data">
        {{ each data item }}
            <tr>
                <td>{{ item.title }}</td>
                <td>{{ item.cate_name }}</td>
                <td>{{ item.pub_date }}</td>
                <td>{{ item.state }}</td>
                <td>
                    <button type="button" class="layui-btn layui-btn-xs list-edit" data-id="{{ item.id }}">编辑</button>
                    <button type="button" class="layui-btn layui-btn-xs layui-btn-danger list-delete"
                        data-index="{{ item.id }}">删除</button>
                </td>
            </tr>
        {{ /each }}
    </script>
    <!-- 文章列表 模板 结束 -->


    <!-- 筛选下拉框 模板 开始 -->
    <script type="text/html" id="sele_list">
        <option value="">所有分类</option>
        {{ each data item }}
            <option value="{{ item.id }}">{{ item.name }}</option>
        {{ /each }}
    </script>
    <!-- 筛选下拉框 模板 结束 -->


    <script src="../assets/lib/jquery.js"></script>
    <script src="../assets/lib/layui/layui.all.js"></script>
    <!-- 模板引擎 -->
    <script src="../assets/lib/template-web.js"></script>

    <script src="../assets/js/common.js"></script>
    <!-- 自己的 -->
    <script src="../assets/js/article/list.js"></script>
</body>

</html>